Tommy Flynn

1 Setup

code
knitr::opts_chunk$set(error = FALSE,
                      tidy = TRUE,
                      # tidy.opts = list(width.cutoff = 60),
                      message = FALSE,
                      warning = FALSE)
library(tidyverse)
library(readxl)
library(readr)
library(haven)
library(knitr)
library(kableExtra)
library(lubridate)
library(labelled)
library(gtsummary)
code
# Working directory saved as `wd` and data path as `data_path`
wd <- getwd()
data_path <- paste(wd, "Data", sep = "/")

2 Identification numbers

2.1 id_sid_matchup

# Import & clean id_sid_matchup2.sas7bdat
id_sid_matchup2 <- read_sas(paste(data_path, "ids", "id_sid_matchup2.sas7bdat", sep = "/"))
id_sid_clean <- id_sid_matchup2 %>%
    transmute(sid, newsid = as.character(newsid), shift_num = str_extract(shift_num_ampm,
        "[:digit:]+"), date = d8, am_pm = str_extract(shift_num_ampm, "am|pm"), shift_start_dttm = startd8time,
        shift_start_tm = ShiftStart, shift_end_dttm = ymd_hms(paste(date, ShiftEnd)),
        shift_end_tm = ShiftEnd, staff = as_factor(staff))

# preview id_sid_match_cleaned
rmarkdown::paged_table(id_sid_clean)
# Save id_sid_clean to files in csv and Rdata format write_csv(id_sid_clean,
# path = paste(data_path, 'Rdata', 'id_sid_clean.Rdata', sep = '/'))
# write_csv(id_sid_clean, path = paste(data_path, 'csv_files',
# 'id_sid_clean.csv', sep = '/'))

2.2 id_final

ids_final <- read_sas(paste(data_path, "ids", "finalsids6944.sas7bdat", sep = "/"))
# preview ids_final (no cleaning needed)
rmarkdown::paged_table(ids_final)
# Check if sids repeate within shifts:
ids_final %>%
    group_by(shift_num) %>%
    count(sid) %>%
    filter(n > 1) %>%
    rmarkdown::paged_table()

2.3 pt_sids

pt_sids <- read_sas(paste(data_path, "ids", "patientSIDs_in_completepat.sas7bdat",
    sep = "/"))
# preview unclean pt_sids glimpse(pt_sids)
pt_sid_clean <- pt_sids %>%
    transmute(sid, shift_num = str_extract(shift_num_ampm, "[:digit:]+"), shift_ampm = as_factor(str_extract(shift_num_ampm,
        "am|pm")))
# preview pt_sid_clean
rmarkdown::paged_table(pt_sid_clean)
pt_sid_clean %>%
    group_by(shift_num) %>%
    count(shift_ampm) %>%
    arrange(shift_num) %>%
    rmarkdown::paged_table()
pt_sid_clean %>%
    count(shift_ampm) %>%
    rmarkdown::paged_table()
# Save to file write_rds(pt_sid_clean, path = paste(data_path, 'Rdata',
# 'pt_sid_clean.Rdata', sep = '/')) write_csv(pt_sid_clean, path =
# paste(data_path, 'csv_files', 'pt_sid_clean.csv', sep = '/'))
# generate_dictionary(pt_sid_clean)

##staff_sids

staff_sids <- read_sas(paste(data_path, "ids", "staffsids_in_eventfile.sas7bdat",
    sep = "/"))
str(staff_sids)
tibble [95 × 5] (S3: tbl_df/tbl/data.frame)
 $ sid            : chr [1:95] "0002f35c" "0002f43c" "0002f445" "0002f447" ...
 $ job            : chr [1:95] "" "" "" "" ...
 $ job_SAH        : chr [1:95] "STAFF" "RN" "STAFF" "RN" ...
 $ ParticipantCat4: chr [1:95] "STAFF" "RN" "STAFF" "RN" ...
  ..- attr(*, "label")= chr "MD/RN/Staff/Patient"
 $ JOBTITLE       : chr [1:95] "STAFF" "RN" "STAFF" "RN" ...
staff_sids_clean <- staff_sids %>%
    mutate(across(.cols = !sid, .fns = as.factor)) %>%
    select(-job)
rmarkdown::paged_table(staff_sids_clean)
staff_sids_clean %>%
    count(ParticipantCat4) %>%
    rmarkdown::paged_table()
# Save to file
write_csv(staff_sids_clean, file = paste(data_path, "Rdata", "staff_sids_clean.Rdata",
    sep = "/"))
write_csv(staff_sids_clean, file = paste(data_path, "csv_files", "staff_sids_clean.csv",
    sep = "/"))
# generate_dictionary(staff_sids_clean)

2.4 allstaff

allstaff <- read_sas(paste(data_path, "staff", "allstaff_numbyshift.sas7bdat", sep = "/"))
# str(allstaff)
allstaff_clean <- allstaff %>%
    mutate(job_title = as_factor(JOBTITLE), .keep = "unused")
# write_rds(allstaff_clean, paste(data_path, 'Rdata', 'allstaff_clean.Rdata',
# sep = '/')) write_csv(allstaff_clean, paste(data_path, 'csv_files',
# 'allstaff_clean.csv', sep = '/'))
rmarkdown::paged_table(allstaff_clean)
# generate_dictionary(allstaff_clean)

2.5 ntab2

ntab2 <- read_csv(file = paste(data_path, "ids", "nTab2.csv", sep = "/"))
# glimpse(ntab2)
ntab2_clean <- ntab2 %>%
    transmute(observation = obs, sid = sids, id = as.character(ID), date = dmy(D8),
        shift_num = shiftnum, shift_person = person, staff = as_factor(staff), degree,
        wdegree, WtAlpha)

rmarkdown::paged_table(ntab2_clean)
# save to file write_rds(ntab2_clean, file = paste(data_path, 'Rdata',
# 'ntab2_clean.Rdata', sep = '/')) write_csv(ntab2_clean, file =
# paste(data_path, 'csv_files', 'ntab2_clean.csv', sep = '/'))
# generate_dictionary(ntab2_clean)

ntab2 lists 6944 observations inclusive of all shifts. These observations list up to - individuals per shift, all 81 shifts.

3 Shift Info

3.1 shift_times

shift_times <- read_xls(paste(data_path, "shifts", "Shift Start End times v3.xls",
    sep = "/"), col_names = c("date", "shift_start_tm", "shift_end_tm", "shift_ampm",
    "comments"), col_types = c("date", "guess", "guess", "text", "text", "skip",
    "skip", "skip", "skip", "skip", "skip"), skip = 1)
# shift_times %>% str()
rmarkdown::paged_table(shift_times)
# generate_dictionary(shift_times) write_csv(shift_times, file =
# paste(data_path, 'csv_files', 'shift_times.csv', sep = '/'))
# write_rds(shift_times, file = paste(data_path, 'Rdata', 'shift_times.Rdata',
# sep = '/'))

3.2 counts_per_shift

counts_per_shift <- read_sas(paste(data_path, "shifts", "countspershift.sas7bdat",
    sep = "/"))
# str(counts_per_shift)
countspershift_clean <- counts_per_shift %>%
    transmute(shift_num, date = d8, am_pm = str_extract(shift_num_ampm, "am|pm"),
        staffcount = as.integer(staffcount), patcount = as.integer(patcount), total = as.integer(total))
rmarkdown::paged_table(countspershift_clean)
# write_rds(countspershift_clean, file = paste(data_path, 'Rdata',
# 'countspershift_clean.Rdata', sep = '/')) write_csv(countspershift_clean,
# file = paste(data_path, 'csv_files', 'countspershift_clean.csv', sep = '/'))

3.3 person_dataset

person_dataset <- read_sas(paste(data_path, "patients", "person_dataset.sas7bdat",
    sep = "/"))

person_dataset <- person_dataset %>%
    transmute(shift_num = as.integer(shiftnum), person = as.character(person), staff = as_factor(staff),
        degree, minutes)
rmarkdown::paged_table(person_dataset)
# generate_dictionary(person_dataset) write_rds(person_dataset,
# paste(data_path, 'Rdata', 'person_dataset.Rdata', sep = '/'))
# write_csv(person_dataset, paste(data_path, 'csv_files', 'person_dataset.csv',
# sep = '/'))

4 Room Info

4.0.1 location_categories

location_cats <- read_sas(paste(data_path, "rooms", "location_categories_list.sas7bdat",
    sep = "/"))
rmarkdown::paged_table(location_cats)

4.0.2 location_defs

location_defs <- read_sas(paste(data_path, "rooms", "location_definitions.sas7bdat",
    sep = "/"))
rmarkdown::paged_table(location_defs)
# generate_dictionary(location_defs)

4.0.3 room_locs

room_locs <- read_xlsx(paste(data_path, "rooms", "Room Locations and Square Footage - with Correction.xlsx",
    sep = "/"), col_names = c("id", "name", "type", "sqft_area"), col_types = c("text",
    "text", "text", "numeric", "skip"), skip = 1)
rmarkdown::paged_table(room_locs)

4.0.4 locations_list

locations_list <- read_sas(paste(data_path, "rooms", "locationslist.sas7bdat", sep = "/"))
rmarkdown::paged_table(locations_list)

5 Patient Data

5.1 Patient Demographics

Demographic information with med_rec numbers and encounter numbers. Note that med_rec numbers may repeat!

5.1.1 demographics_df

demographic_df <- read_csv(paste(data_path, "patients", "Population_Patient_Demographics.csv", sep = "/"))
# glimpse(demographic_df)
demographics_clean <- demographic_df %>%
  transmute(med_rec_no = as.character(`Medical Record Number`),
         encounter_no = as.character(`Enc .`),
         arrival_date = mdy(`ED Arrival Timestamp`), 
         departure_date = mdy(`ED Departure Timestamp`),
         # across(!where(is.Date)
         #        & !where(is.double)
         #        & !where(is.integer)
         #        & !med_rec_no
         #        & !encounter_no
         #        & !`ED Arrival Timestamp`
         #        & !`ED Departure Timestamp`
         #        & !`Chief Complaint`
         #        & !`% ED Patients Admitted as Inpt or Obs`, 
         #        .fns = as_factor),
         sex = as_factor(Sex, ),
         age = `Patient Age at Visit`,
         race = as_factor(Race),
         chief_complaint = `Chief Complaint`,
         acuity = as_factor(Acuity),
         arrival_mode = as_factor(`Arr Mode`),
         disposition = as_factor(`ED Disposition`)) %>% 
  # str()
# demographics_clean_test %>% 
  mutate(across(where(is.factor), ~recode(.x, `Not Recorded` = NA_character_, `Unknown` = NA_character_))) %>% 
  mutate(acuity = fct_relevel(acuity,
                              "1 Immediate",
                              "2 Emergent",
                              "3 Urgent",
                              "4 Stable",
                              "5 Non Urgent"),
         arrival_cat = fct_recode(arrival_mode,
                                  "EMS" = "EMS Ground",
                                  "EMS" = "EMS Air",
                                  "Custody" = "Police/Jail",
                                  "Ambulatory" = "Private Vehicle",
                                  "Ambulatory" = "Public Trans", 
                                  "Ambulatory" = "Walk"),
         race = fct_relevel(race,
                            "Black",
                            "White",
                            "Hispanic",
                            "Asian",
                            "Other",
                            "1",
                            "2",
                            "3"), .after = 10)
# generate_dictionary(demographics_clean_test)

# generate_dictionary(demographics_clean)

rmarkdown::paged_table(demographics_clean)
demographics_clean %>% 
  count(race) %>% 
  rmarkdown::paged_table()
demographics_clean %>% 
  group_by(acuity) %>% 
  summarise(`Total (n)` = n(), 
            `Black (n)` = sum(race == "Black", na.rm = TRUE),
            `Black (%)` = round((`Black (n)`/`Total (n)`)*100, 2),
            `White (n)` = sum(race == "White", na.rm = TRUE),
            `White (%)` = round((`White (n)`/`Total (n)`)*100, 2),
            `Hispanic (n)` = sum(race == "Hispanic", na.rm = TRUE),
            `Hispanic (%)` = round((`Hispanic (n)`/`Total (n)`) * 100, 2),
            `Other (n)` = sum(race == "Other", na.rm = TRUE),
            `Other (%)` = round((`Other (n)`/`Total (n)`) * 100, 2),
            `Missing (n)` = sum(is.na(race)),
            `Missing (%)` = round((`Missing (n)`/`Total (n)`) * 100, 2)) %>% 
  rename(Acuity = acuity) %>% 
  rmarkdown::paged_table()
# write_rds(demographics_clean, paste(data_path, "Rdata", "demographics_clean.Rdata", sep = "/"))
# write_csv(demographics_clean, paste(data_path, "csv_files", "demographics_clean.csv", sep = "/"))

5.1.2 pop_pt_demographics

pop_pt_demographics <- read_csv(paste(data_path, "patients", "Population_Patient_Demographics.csv",
    sep = "/"))
nms <- c("arrival_date", "med_rec_no", "encounter_no", "sex", "age", "race", "chief_complaint",
    "acuity", "arrival_mode", "departure_date", "disposition", "prop_admitted")
names(pop_pt_demographics) <- nms
# str(pop_pt_demographics) generate_dictionary(pop_pt_demographics)
pop_pt_demo_clean <- pop_pt_demographics %>%
    mutate(med_rec_no = as.character(med_rec_no), encounter_no = as.character(encounter_no),
        arrival_date = mdy(arrival_date), .after = 3, departure_date = mdy(departure_date),
        sex = as_factor(sex), race = as_factor(race), acuity = as_factor(acuity),
        arrival_mode = as_factor(arrival_mode)) %>%
    mutate(across(where(is.factor), ~recode(.x, `Not Recorded` = NA_character_, Unknown = NA_character_))) %>%
    mutate(acuity = fct_relevel(acuity, "1 Immediate", "2 Emergent", "3 Urgent",
        "4 Stable", "5 Non Urgent"), arrival_cat = fct_recode(arrival_mode, EMS = "EMS Ground",
        EMS = "EMS Air", Custody = "Police/Jail", Ambulatory = "Private Vehicle",
        Ambulatory = "Public Trans", Ambulatory = "Walk"), .after = 9, race = fct_relevel(race,
        "Black", "White", "Hispanic", "Asian", "Other", "1", "2", "3"))

rmarkdown::paged_table(pop_pt_demo_clean)
# generate_dictionary(pop_pt_demo_clean) write_csv(pop_pt_demo_clean, file =
# paste(data_path, 'csv_files', 'pop_pt_demo_clean.csv', sep = '/'))
# write_rds(pop_pt_demo_clean, file = paste(data_path, 'Rdata',
# 'pop_pt_demo_clean.Rdata', sep = '/'))

5.1.3 pts_population

pts_population <- read_sas(paste(data_path, "patients", "Patients_population.sas7bdat",
    sep = "/"))
rmarkdown::paged_table(pts_population)
# generate_dictionary(pts_population) write_csv(pts_population, file =
# paste(data_path, 'csv_files', 'pts_population.csv', sep = '/'))
# write_rds(pts_population, file = paste(data_path, 'Rdata',
# 'pts_population.Rdata', sep = '/'))

5.1.4 pts_pop2

pts_pop2 <- read_sas(paste(data_path, "patients", "patients_population2.sas7bdat",
    sep = "/"))
rmarkdown::paged_table(pts_pop2)
# generate_dictionary(pts_pop2)

# write_csv(pts_pop2, file = paste(data_path, 'csv_files', 'pts_pop2.csv', sep
# = '/')) write_rds(pts_pop2, file = paste(data_path, 'Rdata',
# 'pts_pop2.Rdata', sep = '/'))

“completepat.sas7bdat” contains RFID badge locations (by room number) for each sampled patient for every second they were monitored in the ED.

The file is large, so subset a random sample of observations with slice_sample() to test code for wrangling.

Use pivot_longer() to reshape from wide format to long format by collapsing all location-by-second columns (variables flocX$, where X is the shift time in seconds that the respective SID was identified in room number flocX) into two columns, names set to seconds and values to location.

Note that pivot_longer() will create many duplicate SIDs and many NAs which will require filtering.

5.2 Patient RFID Data

5.2.1 pt_complete

code
pt_complete <- read_sas(paste(data_path, "patients", "completepat.sas7bdat", sep = "/"))
# glimpse(pt_complete)
# 1. subset a random sample of 30 observations for data transformation code preparation
# set.seed(711)
# pt_complete_sample <- pt_complete %>% slice_sample(n = 30)
# pt_complete_sample %>%
pt_complete_long <- pt_complete %>%

# 2. Pivot the data.frame from wide to long by placing all column names that start with "floc" into a new column, "seconds," and placing respective observations for each "floc" variable into a "location_num" column
  pivot_longer(cols = starts_with("floc"), 
               names_to = "shift_second", # moves column names to new column "seconds"
               values_to = "location_num", # moves location numbers to new column "location_num"
               values_drop_na = TRUE) %>% # removes all rows (observations) without location data
# 3. Delete the prefix "floc" from `seconds` and change class to numeric
  mutate(shift_second = as.double(str_replace(shift_second, "floc", "")),
         location_num = as_factor(location_num),
         shift_num_ampm = str_trim(shift_num_ampm),
         am_pm = as_factor(str_extract(shift_num_ampm, "am|pm")),
         shift_num = as.integer(str_extract(shift_num_ampm, "[:digit:]+")),
         date = make_date(year = year, month = mon, day = day)) %>% 
  select(sid, date, shift_num, am_pm, location_num, shift_second) %>% 
  # count(am_pm)
  mutate(day_night = as_factor(if_else(am_pm == "am", "day", "night")),
         .after = 4) # %>% 
  # glimpse()
# Save as .Rdata file
rmarkdown::paged_table(pt_complete_long)
code
# write_rds(pt_complete_long, file = paste(data_path, "Rdata", "pt_complete_long.Rdata", sep = "/"))
# write_csv(pt_complete_long, file = paste(data_path, "csv_files", "pt_complete_long.csv", sep = "/"))
# generate_dictionary(pt_complete_long)

After transforming & cleaning “completepat.sas7bdat”, pt_complete_long is 7 variables wide and 61342625 rows long.

6 Staff Data

6.1 Staff RFID data

The SAS data file, “completestaff.sas7bdat,” contains RFID badge location (by room number) for all staff each second of every shift.

6.1.1 staff_complete

# 1. pull 'completestaff.sas7bdat' from `sas_data_list` as `tibble()`
staff_complete <- read_sas(paste(data_path, "staff", "completestaff.sas7bdat", sep = "/"))
# Subset a random sample of 30 observations set.seed(321) staff_complete_sample
# <- staff_complete %>% slice_sample(n = 30) 2. Use a random sample of
# staff_complete for data cleaning & transformation
staff_complete_long <- staff_complete %>%
    # 2a. Pivot the data.frame from wide to long by placing all column names
    # that start with 'floc' into a new column, 'seconds,' and placing
    # respective observations for each 'floc' variable into a 'location_num'
    # column
pivot_longer(cols = starts_with("floc"), names_to = "seconds", values_to = "location_num",
    values_drop_na = TRUE) %>%
    # 2b. Remove the prefix 'floc' from `time_seconds` and keep the digits as
    # `seconds`
mutate(seconds = as.double(str_replace(seconds, "floc", "")), location_num = as_factor(location_num),
    shift_num_ampm = str_trim(shift_num_ampm), shift_num = as.integer(str_extract(shift_num_ampm,
        "[:digit:]+")), am_pm = as_factor(str_extract(shift_num_ampm, "am|pm")),
    date = make_date(year = year, month = mon, day = day)) %>%
    select(-d8:-mon)

# staff_complete_sample2 write_rds(staff_complete_long, file = paste(data_path,
# 'Rdata', 'staff_complete_long.Rdata', sep = '/'))
# write_csv(staff_complete_long, file = paste(data_path, 'csv_files',
# 'staff_complete_long.csv', sep = '/')) 3. View data frame structure
# generate_dictionary(staff_complete_long)
rmarkdown::paged_table(staff_complete_long)

7 Network Data

7.1 Whole Networks

7.1.1 net_all_xl

net_all_xl <- read_xlsx(paste(data_path, "networks", "network_allshifts.xlsx", sep = "/"))
str(net_all_xl)
tibble [46,062 × 17] (S3: tbl_df/tbl/data.frame)
 $ i         : num [1:46062] 34 34 34 34 34 34 34 34 35 35 ...
 $ any       : num [1:46062] 1 1 1 1 1 1 1 1 1 1 ...
 $ staffi    : num [1:46062] 0 0 0 0 0 0 0 0 0 0 ...
 $ idi       : num [1:46062] 79200934 79200934 79200934 79200934 79200934 ...
 $ d8        : POSIXct[1:46062], format: "2009-07-09" "2009-07-09" ...
 $ H1N1      : num [1:46062] 0 0 0 0 0 0 0 0 0 0 ...
 $ quarter   : num [1:46062] 1 1 1 1 1 1 1 1 1 1 ...
 $ shiftampm : num [1:46062] 2 2 2 2 2 2 2 2 2 2 ...
 $ d9        : num [1:46062] 5 5 5 5 5 5 5 5 5 5 ...
 $ edgeweight: num [1:46062] 0.0639 0.0806 0.2206 0.0706 0.0119 ...
 $ j         : num [1:46062] 37 66 80 84 85 86 93 98 38 40 ...
 $ staffj    : num [1:46062] 0 0 0 0 0 0 0 0 0 0 ...
 $ combo     : num [1:46062] 0 0 0 0 0 0 0 0 0 0 ...
 $ idj       : num [1:46062] 79200937 79200966 79200980 79200984 79200985 ...
 $ comboc    : chr [1:46062] "0 patient-patient" "0 patient-patient" "0 patient-patient" "0 patient-patient" ...
 $ minutes   : num [1:46062] 3.833 4.833 13.233 4.233 0.717 ...
 $ shiftnum  : num [1:46062] 1 1 1 1 1 1 1 1 1 1 ...
net_all_xl %>%
    rmarkdown::paged_table()

7.1.2 net_all_sas

net_all_sas <- read_sas(paste(data_path, "networks", "network_allshifts.sas7bdat",
    sep = "/"))
# str(net_all_sas)
net_all_sas %>%
    rmarkdown::paged_table()
generate_dictionary(net_all_sas)
 pos variable   label                                          col_type values
 1   i          one member of contact pair (find real id usin~ dbl            
 2   any        any contact 1yes 0no                           dbl            
 3   staffi     i is a staff member 1yes 0no                   dbl            
 4   idi        id for i made of d8 and i                      chr            
 5   d8         1st d8 in the shift                            date           
 6   H1N1       in H1N1 season 1yes                            dbl            
 7   quarter    study qtr, July-Sept09 is first qtr            dbl            
 8   shiftampm  time of shift (1day, 2night)                   dbl            
 9   d9         day of week that shift started                 dbl            
 10  edgeweight hours of contact                               dbl            
 11  j          second member of contact pair (find real id u~ dbl            
 12  staffj     j is a staff member 1 yes 0no                  dbl            
 13  combo      type of contact 0(pp) 1(ps) 2(ss)              dbl            
 14  idj        id for j made of d8 and j                      chr            
 15  comboc     patient-staff combinations                     chr            

7.2 Edges

7.2.1 edges_all

edges_all <- read_sas(paste(data_path, "networks", "allshifts_edges.sas7bdat", sep = "/"))
# str(edges_all)
edges_all %>%
    rmarkdown::paged_table()
edges2 <- read_sas(paste(data_path, "networks", "edges2.sas7bdat", sep = "/"))
rmarkdown::paged_table(edges2)

7.3 Events

7.3.1 events_long

events_long <- read_sas(paste(data_path, "events", "eventfile_long2.sas7bdat", sep = "/"))
rmarkdown::paged_table(events_long)
# write_csv(events_long, file = paste(data_path, 'csv_files',
# 'events_long.csv', sep = '/'))

events_long has duplicates, use eventfile_nodup if needed.

7.3.2 events_unique

events_unique <- read_sas(paste(data_path, "events", "events_uniquepersid2.sas7bdat",
    sep = "/"))
rmarkdown::paged_table(events_unique)

7.3.3 eventfile_nodup

eventfile_nodup <- read_sas(paste(data_path, "events", "eventfile_long6944_noduploc.sas7bdat",
    sep = "/"))
eventfile_nodup %>%
    rmarkdown::paged_table()
# write_csv(eventfile_nodup, file = paste(data_path, 'csv_files',
# 'eventfile_nodup.csv', sep = '/')) write_rds(eventfile_nodup, file =
# paste(data_path, 'Rdata', 'eventfile_nodup.Rdata', sep = '/'))

8 Data Dictionary

dictionary <- lst(id_sid_clean = names(id_sid_clean), ids_final = names(ids_final),
    pt_sid_clean = names(pt_sid_clean), person_dataset = names(person_dataset), allstaff_clean = names(allstaff_clean),
    staff_sids_clean = names(staff_sids_clean), shift_times = names(shift_times),
    ntab2_clean = names(ntab2_clean), demographics_clean = names(demographics_clean),
    pop_pt_demo_clean = names(pop_pt_demo_clean), pts_pop2 = names(pts_pop2), pt_complete_long = names(pt_complete_long),
    staff_complete_long = names(staff_complete_long), location_defs = names(location_defs),
    net_all_xl = names(net_all_xl), net_all_sas = names(net_all_sas), edges_all = names(edges_all),
    edges2 = names(edges2), events_long = names(events_long), events_unique = names(events_unique),
    eventfile_nodup = names(eventfile_nodup))
dictionary_tbl <- unnest((tibble(names = names(dictionary), var_list = dictionary)))

write_csv(dictionary_tbl, file = paste(data_path, "dictionaries", "dictionary_tbl.csv",
    sep = "/"))
rmarkdown::paged_table(dictionary_tbl)

9 SessionInfo

sessioninfo::session_info() %>%
    details::details(summary = "Current session info", open = FALSE)
Current session info

─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.1.2 (2021-11-01)
 os       macOS Big Sur 10.16
 system   x86_64, darwin17.0
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/New_York
 date     2022-04-24
 pandoc   2.17.1.1 @ /Applications/RStudio.app/Contents/MacOS/quarto/bin/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 package       * version    date (UTC) lib source
 assertthat      0.2.1      2019-03-21 [1] CRAN (R 4.1.0)
 backports       1.4.1      2021-12-13 [1] CRAN (R 4.1.0)
 bit             4.0.4      2020-08-04 [1] CRAN (R 4.1.0)
 bit64           4.0.5      2020-08-30 [1] CRAN (R 4.1.0)
 broom           0.7.12     2022-01-28 [1] CRAN (R 4.1.2)
 broom.helpers   1.6.0      2022-01-12 [1] CRAN (R 4.1.2)
 cellranger      1.1.0      2016-07-27 [1] CRAN (R 4.1.0)
 cli             3.2.0      2022-02-14 [1] CRAN (R 4.1.2)
 clipr           0.8.0      2022-02-22 [1] CRAN (R 4.1.2)
 colorspace      2.0-3      2022-02-21 [1] CRAN (R 4.1.2)
 crayon          1.5.0      2022-02-14 [1] CRAN (R 4.1.2)
 DBI             1.1.2      2021-12-20 [1] CRAN (R 4.1.0)
 dbplyr          2.1.1      2021-04-06 [1] CRAN (R 4.1.0)
 desc            1.4.0      2021-09-28 [1] CRAN (R 4.1.0)
 details         0.2.1      2020-01-12 [1] CRAN (R 4.1.0)
 digest          0.6.29     2021-12-01 [1] CRAN (R 4.1.0)
 dplyr         * 1.0.8      2022-02-08 [1] CRAN (R 4.1.2)
 ellipsis        0.3.2      2021-04-29 [1] CRAN (R 4.1.0)
 evaluate        0.15       2022-02-18 [1] CRAN (R 4.1.2)
 fansi           1.0.2      2022-01-14 [1] CRAN (R 4.1.2)
 fastmap         1.1.0      2021-01-25 [1] CRAN (R 4.1.0)
 forcats       * 0.5.1      2021-01-27 [1] CRAN (R 4.1.0)
 formatR         1.11       2021-06-01 [1] CRAN (R 4.1.0)
 fs              1.5.2      2021-12-08 [1] CRAN (R 4.1.0)
 generics        0.1.2      2022-01-31 [1] CRAN (R 4.1.2)
 ggplot2       * 3.3.5      2021-06-25 [1] CRAN (R 4.1.0)
 glue            1.6.2      2022-02-24 [1] CRAN (R 4.1.2)
 gt              0.4.0      2022-02-15 [1] CRAN (R 4.1.2)
 gtable          0.3.0      2019-03-25 [1] CRAN (R 4.1.0)
 gtsummary     * 1.5.2      2022-01-29 [1] CRAN (R 4.1.2)
 haven         * 2.4.3      2021-08-04 [1] CRAN (R 4.1.0)
 hms             1.1.1      2021-09-26 [1] CRAN (R 4.1.0)
 htmltools       0.5.2      2021-08-25 [1] CRAN (R 4.1.0)
 htmlwidgets     1.5.4      2021-09-08 [1] CRAN (R 4.1.0)
 httr            1.4.2      2020-07-20 [1] CRAN (R 4.1.0)
 jsonlite        1.8.0      2022-02-22 [1] CRAN (R 4.1.2)
 kableExtra    * 1.3.4      2021-02-20 [1] CRAN (R 4.1.0)
 knitr         * 1.37       2021-12-16 [1] CRAN (R 4.1.0)
 labelled      * 2.9.0      2021-10-29 [1] CRAN (R 4.1.0)
 lifecycle       1.0.1      2021-09-24 [1] CRAN (R 4.1.0)
 lubridate     * 1.8.0      2021-10-07 [1] CRAN (R 4.1.0)
 magrittr        2.0.2      2022-01-26 [1] CRAN (R 4.1.2)
 modelr          0.1.8      2020-05-19 [1] CRAN (R 4.1.0)
 munsell         0.5.0      2018-06-12 [1] CRAN (R 4.1.0)
 pillar          1.7.0      2022-02-01 [1] CRAN (R 4.1.2)
 pkgconfig       2.0.3      2019-09-22 [1] CRAN (R 4.1.0)
 png             0.1-7      2013-12-03 [1] CRAN (R 4.1.0)
 purrr         * 0.3.4      2020-04-17 [1] CRAN (R 4.1.0)
 R6              2.5.1      2021-08-19 [1] CRAN (R 4.1.0)
 Rcpp            1.0.8      2022-01-13 [1] CRAN (R 4.1.2)
 readr         * 2.1.2      2022-01-30 [1] CRAN (R 4.1.2)
 readxl        * 1.3.1      2019-03-13 [1] CRAN (R 4.1.0)
 reprex          2.0.1      2021-08-05 [1] CRAN (R 4.1.0)
 rlang           1.0.1      2022-02-03 [1] CRAN (R 4.1.2)
 rmarkdown       2.11       2021-09-14 [1] CRAN (R 4.1.0)
 rprojroot       2.0.2      2020-11-15 [1] CRAN (R 4.1.0)
 rstudioapi      0.13       2020-11-12 [1] CRAN (R 4.1.0)
 rvest           1.0.2      2021-10-16 [1] CRAN (R 4.1.0)
 scales          1.1.1      2020-05-11 [1] CRAN (R 4.1.0)
 sessioninfo     1.2.2      2021-12-06 [1] CRAN (R 4.1.0)
 stringi         1.7.6      2021-11-29 [1] CRAN (R 4.1.0)
 stringr       * 1.4.0      2019-02-10 [1] CRAN (R 4.1.0)
 svglite         2.1.0      2022-02-03 [1] CRAN (R 4.1.2)
 systemfonts     1.0.4      2022-02-11 [1] CRAN (R 4.1.2)
 tibble        * 3.1.6      2021-11-07 [1] CRAN (R 4.1.0)
 tidyr         * 1.2.0      2022-02-01 [1] CRAN (R 4.1.2)
 tidyselect      1.1.1.9000 2022-03-02 [1] Github (r-lib/tidyselect@00e8f39)
 tidyverse     * 1.3.1      2021-04-15 [1] CRAN (R 4.1.0)
 tzdb            0.2.0      2021-10-27 [1] CRAN (R 4.1.0)
 utf8            1.2.2      2021-07-24 [1] CRAN (R 4.1.0)
 vctrs           0.3.8.9001 2022-03-02 [1] Github (r-lib/vctrs@f0c4ead)
 viridisLite     0.4.0      2021-04-13 [1] CRAN (R 4.1.0)
 vroom           1.5.7      2021-11-30 [1] CRAN (R 4.1.0)
 webshot         0.5.2      2019-11-22 [1] CRAN (R 4.1.0)
 withr           2.4.3      2021-11-30 [1] CRAN (R 4.1.0)
 xfun            0.29       2021-12-14 [1] CRAN (R 4.1.0)
 xml2            1.3.3      2021-11-30 [1] CRAN (R 4.1.0)
 yaml            2.3.5      2022-02-21 [1] CRAN (R 4.1.2)

 [1] /Library/Frameworks/R.framework/Versions/4.1/Resources/library

──────────────────────────────────────────────────────────────────────────────